<!DOCTYPE html>
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="stylesheet" type="text/css" href="resources/tablet.css">
<link rel="stylesheet" type="text/css" href="resources/transition.css">
<script src="resources/perf_test_helper.js"></script>
<style>
.keyframe0 {
  opacity: 0;
}
.keyframe1 {
  opacity: 1;
}
</style>

<container id="container"></container>

<script>
var N = PerfTestHelper.getN(1000);
var duration = 1000;
var keyframe = 1;
var targets = [];

for (var i = 0; i < N; i++) {
  var target = document.createElement('target');
  container.appendChild(target);
  targets.push(target);
}

function startAllTransitions() {
  keyframe ^= 1;
  targets.forEach(function(target) {
    target.className = 'keyframe' + keyframe;
  });
}

requestAnimationFrame(startAllTransitions);
setInterval(startAllTransitions, duration);

PerfTestHelper.signalReady();
</script>
